package jgjc.controller;

import com.alibaba.fastjson.JSONArray;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@Slf4j
@RestController
public class FunctionServiceController {

    @Resource
    private RestTemplate restTemplate;

    private String serviceUrl = "http://Function-Management";

    @GetMapping(value = "/consumer/menuFunction/getAuthorizedMenuFunction")
    public JSONArray getAuthorizedMenuFunction() {
        JSONArray result = restTemplate.getForObject(serviceUrl + "/menuFunction/getAuthorizedMenuFunction", JSONArray.class);
        return result;
    }

}
